<?php

namespace App\Models;

class Seo extends Base
{
    protected $table = 'seos';



    protected $fillable = [
        'id','name','title','word','description'
    ];

    public $timestamps = false;//关闭自动维护

    /**
     * 获取列表
     * @param array $params 条件参数
     * @param array $fields 查询的字段
     * @return mixed
     */
    protected function getList($params = [], $fields = ['*']){
        $lists = $this->select($fields)->orderBy('id', 'desc')
            ->paginate(config('app.limit'));
        return $lists;
    }

    protected function getSeo($id = 1){
        $seo = $this->findOrFail($id)->toArray();
        return $seo;
    }

}
